import Taro, {Component} from '@tarojs/taro'
import {View, Text, Image} from '@tarojs/components'

import './head.scss'

class Head extends Component {
  render () {
    const {loginname, avatar_url} = this.props
    return (
      <View className='head-wrap'>
        <Image className='img1' src={require('../../assets/images/loginBack.jpg')} />
        <Image className='img2' src={avatar_url ? avatar_url : require('../../assets/images/head.png')} />
        {
          loginname ? <Text className='login-head-name'>{loginname}</Text> : null
        }
      </View>
    )
  }
}

export default Head